< previous page page_919 next page >

Page 919
Testing the Object Model
Start a new Visual Basic 5.0 Standard EXE, and add a single control array of five command buttons to the project. Refer to Figure A.8 for captions, size, and location of the buttons.
0919-01.jpg
Figure A.8.
A test form for the 
SQL-VB5 object model.
To create an instance of SQL-VB5, you need an object variable and you need to set that variable to reference the application class of SQL-VB5. To do this, first add a form-level variable to the general declaration section of the form.
Option Explicit
'
Dim objSQLVB5 As Object
Next, you need to add the following code to the Form_Load event. This code makes the object variable refer to the application class of your compiled SQL-VB5.
Private Sub Form_Load()
    '
    Set objSQLVB5 = CreateObject("SQLVB5.Application")
    '
End Sub
Now you need to add code to the command1_Click event of the form. This contains all the code you need to test the SQL-VB5 object model. Enter the code in Listing A.42 into the Command1_Click event.

 
< previous page page_919 next page >

If you like this book, buy it!